﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using UserDefinedForms.Business;
using UserDefinedForms.Entities;

namespace UDFDesign.GUIComponent.CustomControl
{
    class DesignableComboBox:DesignableControl
    {
        public DesignableComboBox()
        {
        }
        public DesignableComboBox(FormControl entity)
            : base(entity)
        {
        }

        protected override void initControl()
        {
            this.selfControl = new ComboBox();
            selfControl.Enabled = false;
            this.Controls.Add(selfControl);
            this.Size = selfControl.Size;

            ControlListItemService listItemService = new ControlListItemService();
            /*
            if (this.controlORM.ControlId != null)
            {
                TList<ControlListItem> listControlListItem= listItemService.GetByControlId(this.controlORM.ControlId);
                foreach (ControlListItem item in listControlListItem)
                {
                    listValue.Add(item.ItemData);
                }
            }
            */
        }

        public override ControlTypes ControlType
        {
            get
            {
                return ControlTypes.ComboBox;
            }
        }

        public override List<string> List
        {
            get
            {
                return listValue;
            }
            set
            {
                listValue = value;
            }
        }
    }
}
